/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.agtranscontinental.dgs001.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ericson
 */
@Entity
@Table(name = "perfil")
@NamedQueries({
    @NamedQuery(name = "Perfil.findAll", query = "SELECT p FROM Perfil p"),
    @NamedQuery(name = "Perfil.findByIdPf", query = "SELECT p FROM Perfil p WHERE p.idPf = :idPf"),
    @NamedQuery(name = "Perfil.findByNombPf", query = "SELECT p FROM Perfil p WHERE p.nombPf = :nombPf")})
public class Perfil implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_pf")
    private Integer idPf;
    @Size(max = 60)
    @Column(name = "nomb_pf")
    private String nombPf;
    @OneToMany(mappedBy = "perfil")
    private List<Personal> personalList;

    public Perfil() {
    }

    public Perfil(Integer idPf) {
        this.idPf = idPf;
    }

    public Integer getIdPf() {
        return idPf;
    }

    public void setIdPf(Integer idPf) {
        this.idPf = idPf;
    }

    public String getNombPf() {
        return nombPf;
    }

    public void setNombPf(String nombPf) {
        this.nombPf = nombPf;
    }

    public List<Personal> getPersonalList() {
        return personalList;
    }

    public void setPersonalList(List<Personal> personalList) {
        this.personalList = personalList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPf != null ? idPf.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Perfil)) {
            return false;
        }
        Perfil other = (Perfil) object;
        if ((this.idPf == null && other.idPf != null) || (this.idPf != null && !this.idPf.equals(other.idPf))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.agtranconstinental.dgs001.model.Perfil[ idPf=" + idPf + " ]";
    }
    
}
